package cn.tedu.homework.mapper;

import cn.tedu.homework.pojo.entity.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface studentMapper {

//    @Insert("INSERT INTO student(student_id,name,gender,age,class_name) VALUES (#{studentId},#{name},#{gender},#{age},#{className})")
    int insertstudent(Student student);


//    @Delete("DELETE FROM student WHERE id=#{id}")
    int deletestudent(int id);

//    @Insert("UPDATE student SET student_id=#{studentId},name=#{name},gender=#{gender},age=#{age},class_name=#{className} WHERE id=#{id}")
    int updatestudent(Student student);


//    @Select("SELECT student_id studentId,name,gender,age,class_name className FROM student WHERE id=#{id}")
    Student findstudentById(int id);

//    Student findstudentByusernameAndPassword(String username,String password);

//    @Select("SELECT student_id studentId,name,gender,age,class_name className FROM student ")
    List<Student> findAllstudent();
}
